package com.foreknow.demo7;

public class TestAnimal {
    public static void main(String[] args) {
        //创建对象猫并调用属性方法
        Animal animal = new Animal();
        animal.name = "tom cat";
        animal.age = 5;
        animal.color = "yellow";
        animal.leg = 4;
        animal.eat();
        animal.sleep();
        //创建对象狗并调用属性方法
        Animal animal1 = new Animal();
        animal1.name = "大黄";
        animal1.age = 2;
        animal1.color = "white";
        animal1.leg = 4;
        animal1.eat();
        animal1.sleep();

    }
}
